Everything Totally Explained


Ask & we'll explain, totally!
Dynamic programming language
Totally Explained


  NEW! All the latest news in the worlds of computer gaming, entertainment, the environment,  
finance, health, politics, science, stocks & shares, technology and much, much, more.  


View this entry using RSS

Everything about Dynamic Programming Language totally explained

» This article is about a class of programming languages, for the method for reducing the runtime of algorithms, see Dynamic programming.

Dynamic programming language is a term used broadly in computer science to describe a class of high level programming languages that execute at runtime many common behaviors that other languages might perform during compilation, if at all. These behaviors could include extension of the program, by adding new code, by extending objects and definitions, or by modifying the type system, all during program execution. These behaviors can be emulated in nearly any language of sufficient complexity, but dynamic languages provide direct tools to make use of them.
   Dynamic languages and dynamic typing are not identical concepts, and a dynamic language need not be dynamically typed, though many dynamic languages are dynamically typed.

Limitations and ambiguity in the definition

The definition of a dynamic language is ambiguous because it attempts to make distinctions between code and data as well as between compilation and runtime which are not universal. Virtual machines, just-in-time compilation, and the ability of many programming languages on some systems to directly modify machine code make the distinction abstract. In general, the assertion that a language is dynamic is more an assertion about the ease of use of dynamic features than it's a clear statement of the capabilities of the language.

Implementation

There are several mechanisms closely associated with the concept of dynamic programming. None are essential to the classification of a language as dynamic, but most can be found in a wide variety of such languages.

Eval

Eval is a term which was introduced in Lisp, and refers to expression evaluation, the process of executing instructions which are represented by data structures called S-expressions. In its modern sense, eval or evalling refers to the mechanism or process of executing any sort of instructions that are available to the program as text or non-machine code data. The evaluation of new program text is a common aspect of many languages that, unlike Lisp, don't make a distinction between reading text and transforming it into an internal form and further transforming that internal form into actions to be taken. These languages are often called interpreted languages when the process of normal program execution is an eval.

Higher-order functions

However, Erik Meijer and Peter Drayton caution that any language capable of loading executable code at runtime is capable of eval in some respect, even when that code is in the form of dynamically linked shared libraries of machine code. They suggest that higher-order functions are the true measure of dynamic programming, and some languages "use eval as a poor man's substitute for higher-order functions."

Object runtime alteration

A type or object system can typically be modified during runtime in a dynamic language. This can mean generating new objects from a runtime definition or based on mixins of existing types or objects. This can also refer to changing the inheritance or type tree, and thus altering the way that existing types behave (especially with respect to the invocation of methods).

Functional programming

Functional programming concepts are a feature of many dynamic languages, and also derive from Lisp.

Closures

One of the most widely used aspects of functional programming in dynamic languages is the closure, which allows creating a new instance of a function which retains access to the context in which it was created. A simple example of this is generating a function for scanning text for a word:
function new_scanner (word) temp_function = function (input) scan_for_text (input, word) end function return temp_function end function Note that the inner function has no name, and is instead stored in the variable temp_function. Each time new_scanner is executed, it'll return a new function which remembers the value of the word parameter that was passed in when it was defined.
   Closures are one of the core tools of functional programming, and many languages support at least this degree of functional programming.

Continuations

Another feature of some dynamic languages is the continuation. Continuations represent execution state that can be re-invoked. For example, a parser might return an intermediate result and a continuation that, when invoked, will continue to parse the input. Continuations interact in very complex ways with scoping, especially with respect to closures. For this reason, many dynamic languages don't provide continuations.

Reflection

Reflection is common in many dynamic languages, and typically involves analysis of the types and metadata of generic or polymorphic data. It can, however, also include full evaluation and modification of a program's code as data, such as the features that Lisp provides in analyzing S-expressions.

Macros

A limited number of dynamic programming languages provide features which combine code introspection and eval in a feature called macros. Most programmers today who are aware of macros have encountered them in C or C++, where they're a static feature which are built in a small subset of the language, and are capable only of string substitutions on the text of the program. In dynamic languages, however, they provide access to the inner workings of the compiler, and full access to the interpreter, virtual machine, or runtime, allowing the definition of language-like constructs which can optimize code or modify the syntax or grammar of the language.

Languages

  • HyperCard/HyperTalk and Derivatives
  • Io
  • Lisp
  • Lua
  • Maude system
  • Oberon
  • Objective Modula-2
  • Objective-C
  • Perl
  • PHP
  • Pliant
  • POP-11
  • Poplog
  • Pike
  • Prolog
  • Python
  • REALbasic
  • REBOL
  • Ruby
  • Scratch
  • Smalltalk
  • Snobol
  • SuperCollider
  • Tcl
  • TeX macro language
  • VBScript
  • Visual Basic 9 or 10
  • Visual FoxPro
  • Windows PowerShell
  • xHarbour

  • Assembly, C, C++, early Java, and FORTRAN don't generally fit into this category.

    Further Information

    Get more info on 'Dynamic Programming Language'.


    External Link Exchanges

    Do you know how hard it is to get a link from a large encyclopaedia? Well we're different and will prove it. To get a link from us just add the following HTML to your site on a relevant page:

      <a href="http://dynamic_programming_language.totallyexplained.com">Dynamic programming language Totally Explained</a>

    Then simply click through this link from your web page. Our crawlers will verify your link, extract the title of your web page and instantly add a link back to it. If you like you can remove the words Totally Explained and embed the link in article text.
       As long as your link remains in place, we'll keep our link to you right here. Please play fair - our crawlers are watching. Your site must be closely related to this one's topic. Any kind of spamming, dubious practises or removing the link will result in your link from us being dropped and, potentially, your whole site being banned.



    Copyright © 2007-8 totallyexplained.com | Licensed under the GNU Free Documentation License | Site Map
    This article contains text from the Wikipedia article Dynamic programming language (History) and is released under the GFDL | RSS Version